#include <allegro.h>

int main() 
{

BITMAP *Buffer;

BITMAP *Background;
BITMAP *IMAGE;
int continuer=1 ;	

/* General initialization function */
allegro_init();
if (install_keyboard() == -1) {
allegro_message("Error! %s", allegro_error);
return -1;
}
set_color_depth(24);
if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 480, 0, 0) != 0) {
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); /* here’s the command for text mode */
allegro_message("Unable to initialize video mode!\n%s\n", allegro_error);
return 1;
}



Buffer = create_bitmap(800, 480);
Background = load_bitmap("/home/ala/Images/33.bmp", NULL);
IMAGE = load_bitmap("/home/ala/Images/44.bmp", NULL);

if ( Background == NULL)
 {
allegro_message("could not load images");
allegro_exit();
}








blit(Buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);

blit(Background, Buffer, 0, 0, 0, 0, Background->w, Background->h);
blit(Buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
while(continuer!=0)
{
if(  (key[KEY_DOWN]   ))
{
Buffer = create_bitmap(800, 480);	 
blit(IMAGE, Buffer, 0, 0, 0, 0, Background->w, Background->h);	
blit(Buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);	
if (key[KEY_DOWN] )
{
Buffer = create_bitmap(800, 480);	

blit(Background, Buffer, 0, 0, 0, 0, Background->w, Background->h);
}
blit(Buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); 




}


}



return 0;
}

